package yunwo.cn.yzstation.presenter;

import yunwo.cn.yzstation.api.IallFragmentModel;
import yunwo.cn.yzstation.api.IallFragmentView;
import yunwo.cn.yzstation.base.BasePresenter;
import yunwo.cn.yzstation.bean.InventoryBean;
import yunwo.cn.yzstation.model.AllFragmentModel;
import yunwo.cn.yzstation.view.activity.InventoryActivity;
import yunwo.cn.yzstation.view.fregment.inventory.AllFragment;

/**
 * Created by lao on 2017/9/18.
 */

public class AllFragmentPersenter extends BasePresenter<IallFragmentView> implements IallFragmentModel {
    AllFragment allFragment;
    IallFragmentView iallFragmentView;
    private final AllFragmentModel mAllFragmentModel;

    public AllFragmentPersenter(InventoryActivity inventoryActivity , AllFragment allFragment, IallFragmentView iallFragmentView) {
        this.allFragment = allFragment;
        this.iallFragmentView = iallFragmentView;
        mAllFragmentModel = new AllFragmentModel(inventoryActivity, this);
    }

    public void getData(String type,int page,int size) {
        mAllFragmentModel.getData(type,page,size);

    }

    @Override
    public void getListDataSuccess(InventoryBean.DataBean dataBean,String type) {
        iallFragmentView.getListDataSuccess(dataBean,type);
    }

    @Override
    public void getListDataFailure() {
        iallFragmentView.getListDataFailure();
    }
}
